package cn.example.vip.mall.search.feign;


import cn.example.vip.mall.search.entity.SkuEs;
import cn.example.vip.mall.util.RespResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient(value = "mall-search", path = "/search", contextId = "mall-search-elasticsearch-sku")
public interface SkuSearchFeign {
	/**
	 * 关键词搜索，通过参数接收（常用）
	 * @param searchMap
	 * @return RespResult
	 */
	@GetMapping
	RespResult<Map<String, Object>> search(@RequestParam(required = false)Map<String, Object> searchMap);
	
	/**
	 * 增加搜索索引
	 * @param skuEs
	 * @return
	 */
	@PostMapping("/add")
	RespResult add(SkuEs skuEs);
	
	/**
	 * 删除搜索索引
	 * @param id
	 * @return
	 */
	@DeleteMapping("/del/{id}")
	RespResult del(@PathVariable String id);
}
